﻿//---------------------------------------------------------------------
// Author: Reinhard Lehrbaum
//
// Description: Class to represent info returned by Get-DomainController cmdlet.
//
// Creation Date: 2006-12-20
//---------------------------------------------------------------------

using System;

namespace Pscx.Commands.DirectoryServices
{
    public class DCServerInfo
    {
        private string FServerName;
        private string FDNSHostName;
        private string FSite;
        private string FDistinguishedName;
        private string FDomain;
        private bool FGlobalCatalog;

        public string ServerName
        {
            get { return FServerName; }
        }

        public string DNSHostName
        {
            get { return FDNSHostName; }
        }

        public string Site
        {
            get { return FSite; }
        }

        public string Domain
        {
            get { return FDomain; }
        }

        public string DN
        {
            get { return FDistinguishedName; }
        }

        public bool GlobalCatalog
        {
            get { return FGlobalCatalog; }
        }

        public DCServerInfo(string _ServerName, string _DNSHostName, string _DistinguishedName, string _Site, bool _GlobalCatalog)
        {
            FServerName = _ServerName;
            FDNSHostName = _DNSHostName;
            FSite = _Site;
            FDistinguishedName = _DistinguishedName;
            FGlobalCatalog = _GlobalCatalog;

            FDomain = FDistinguishedName.Substring(FDistinguishedName.IndexOf("DC=")).Replace("DC=", "").Replace(",", ".");
        }
    }
}
